#include <iostream>
#include <pthread.h>
#include <unistd.h>
using namespace std;

void *startRoutine(void* args)
{
    while(true)
    {
        cout<<"线程正在运行"<<endl;
        sleep(1);
    }
}

int main()
{
    pthread_t tid;
    int n = pthread_create(&tid,nullptr,startRoutine,(void*)"thread-1");
    cout<<"new thread id:"<<tid<<endl;
    while(true)
    {
        cout<<"main pthread 正在运行"<<endl;
        sleep(1);
    }
    return 0;
}